<UserControl x:Class="OpenPOS.Modules.Users.Views.UsersView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                 xmlns:infrastructure="clr-namespace:OpenPOS.Infrastructure.MVVM;assembly=OpenPOS.Infrastructure"
    xmlns:prism="clr-namespace:Microsoft.Practices.Composite.Presentation.Commands;assembly=Microsoft.Practices.Composite.Presentation">
    <UserControl.Resources>
        <infrastructure:CommandReference Command="{Binding LoginCommand}" x:Key="loginCommandRefrence" />
    </UserControl.Resources>
        
    <Grid x:Name="LayoutRoot"> 
        <Grid.RowDefinitions>
            <RowDefinition Height="*" />
            <RowDefinition Height="300" />
        </Grid.RowDefinitions>
        
        <Border Padding="5,5,5,5" CornerRadius="10,10,10,10" BorderBrush="Black" BorderThickness="1,1,1,1" Background="White" HorizontalAlignment="Center" VerticalAlignment="Center">
            <Border.Effect>
                <DropShadowEffect Opacity="0.5" />
            </Border.Effect>
        <Image Source="/Images/Logo.Png" Stretch="None" />
        </Border>

        <Button Width="170" Height="40" Margin="0,50,50,0" Grid.Row="1" HorizontalAlignment="Right" VerticalAlignment="Top" Command="{Binding ExitCommand}">
            <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
                <Image Source="/Images/Shutdown.png" Stretch="None" />
                <TextBlock Text="Exit" VerticalAlignment="Center" Margin="10,0,0,0" />
            </StackPanel>
        </Button>
        <Border Grid.Row="1" BorderBrush="#AAAAAA" CornerRadius="4,4,4,4" Background="#7FFFFFFF" BorderThickness="1,1,1,1" Margin="100,50,240,50" >
            <ItemsControl ItemsSource="{Binding Users}" Margin="7.5,7.5,7.5,7.5" ScrollViewer.HorizontalScrollBarVisibility="Disabled">
                <ItemsControl.ItemTemplate>
                    <DataTemplate>
                        <Button  Command="{StaticResource loginCommandRefrence}" CommandParameter="{Binding}" Width="200" Height="50" Margin="5,5,5,5">
                            <StackPanel Orientation="Horizontal" HorizontalAlignment="Left" Margin="5,0,0,0" VerticalAlignment="Center" Width="170">
                                <Image Source="/Images/User1.png" Stretch="None" />
                                <TextBlock Text="{Binding Name}" VerticalAlignment="Center" Margin="5,0,0,0"/>
                            </StackPanel>
                        </Button>
                    </DataTemplate>
                </ItemsControl.ItemTemplate>
                <ItemsControl.ItemsPanel>
                    <ItemsPanelTemplate>
                        <WrapPanel />
                    </ItemsPanelTemplate>
                </ItemsControl.ItemsPanel>
            </ItemsControl>
        </Border>
    </Grid>

</UserControl>
